If one uses straight two-way merge sort algorithm to sort the following elements in ascending order: 20,47,15,8,9,4,40,30,12,17 then the order of those elements after the second pass of the algorithm is
A :
8,9,15,20,47,4,12,17,30,40
B :
8,15,20,47,4,9,30,40,12,17
C :
15,20,47,4,8,9,12,30,40,17
D :
4,8,9,15,20,47,12,17,30,40
Answer: B
Q. No. :
2
Question :
A Priority-Queue is implemented as a Max-Heap. Initially, it has 5
elements. The level-order traversal of the heap is given below: 10,
8,5,3,2 Two new elements 1 and 7 are inserted in the heap in that order.
The level-order traversal of the heap after the insertion of the
elements is :
A :
10,8,7,5,3,2,1
B :
10,8,7,2,3,1,5
C :
10,8,7,1,2,3,5
D :
10,8,7,3,2,1,5
Answer: D
Q. No. :
3
Question :
The following numbers are inserted into an empty
binary search tree in the given order: 10, 1, 3, 5, 15, 12, 16. What is
the height of the binary search tree (the height is the maximum distance
of a leaf node from the root)?
A :
2
B :
3
C :
4
D :
5
Answer: B
Q. No. :
4
Question :
A hash table implementation uses function of (% 7) and linear probing
to resolve collision. What is the ratio of numbers in the following
series with out collision and with collision if 7 buckets are used:
32, 56, 87, 23, 65, 26, 93
A :
2,5
B :
3,4
C :
4,3
D :
5,2
Answer: C
Q. No. :
5
Question :
A computer company wants to hire 25 programmers to handle systems programming jobs and 40 programmers for applications programming. Of those hired 10 will be expected to perform jobs of both types. How many programmers must be hired?
A :
65
B :
45
C :
75
D :
55
Answer: D
Q. No. :
6
Question :
What will be the output of the program ?
#include<stdio.h>#include<string.h>int main()
{
int i, n;
char *x="Alice";
n = strlen(x);
*x = x[n];
for(i=0; i<=n; i++)
{
printf("%s ", x);
x++;
}
printf("\n", x);
return0;
}
Divisible by all even number, not divisible by odd number
Answer: C
Q. No. :
8
Question :
Which of the following statements is correct? (i) A static variable may be either an internal type or an external type, depending on the place of declaration. (ii) Internal static variables are those which are declared inside a function. The scope of internal static variables extends upto the end of the function in which they are defined. (iii) The Internal static variables are similar to auto variables, except that they are remain in existence through out the remainder of the program.